<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1 {
            width: 200px;
            height: 200px;
            background-color: pink;
            position: relative;

        }

        /* dpr适配可以这样写 */
        @media (-webkit-min-device-pixel-ratio: 2) {
            .box1::after {
                height: 1px;
                transform: scale(0.5);
                transform-origin: 0 0;
                background-color: red;
                position: absolute;
                left: 0;
                bottom: 0;
                content: "";
                width: 200%;
            }


        }

        @media (-webkit-min-device-pixel-ratio: 3) {
            .box1::after {
                height: 1px;
                transform: scale(0.333);
                transform-origin: 0 0;
                background-color: red;
                position: absolute;
                left: 0;
                bottom: 0;
                content: "";
                width: 200%;
            }
        }
    </style>
</head>

<body>

    <div class="box1"></div>
</body>

</html>